import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { Ab03VO, Ab03Form, Ab03Query } from '@/api/yuanshidian/ab03/types';

/**
 * 查询原离退人员信息列表
 * @param query
 * @returns {*}
 */

export const listAb03 = (query?: Ab03Query): AxiosPromise<Ab03VO[]> => {
  return request({
    url: '/yuanshidian/ab03/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询原离退人员信息详细
 * @param ID
 */
export const getAb03 = (ID: string | number): AxiosPromise<Ab03VO> => {
  return request({
    url: '/yuanshidian/ab03/' + ID,
    method: 'get'
  });
};
/**
 * 查询新在职人员信息详细
 * @param ID
 */
export const getAb03New = (ID: string | number): AxiosPromise<Ab03VO> => {
  return request({
    url: '/yuanshidian/ab03new/' + ID,
    method: 'get'
  });
};
/**
 * 新增原离退人员信息
 * @param data
 */
export const addAb03 = (data: Ab03Form) => {
  return request({
    url: '/yuanshidian/ab03',
    method: 'post',
    data: data
  });
};

/**
 * 修改原离退人员信息
 * @param data
 */
export const updateAb03 = (data: Ab03Form) => {
  return request({
    url: '/yuanshidian/ab03',
    method: 'put',
    data: data
  });
};

/**
 * 删除原离退人员信息
 * @param ID
 */
export const delAb03 = (ID: string | number) => {
  return request({
    url: '/yuanshidian/ab03/' + ID,
    method: 'delete'
  });
};
